﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace CarFrameWork.UI.ProductDesign._3DModelingDesign.FenDongQi
{
    public partial class 挡油板 : PartFormBase
    {
        //CarFrameWork.Model.主齿凸缘螺母 tylm = new CarFrameWork.Model.主齿凸缘螺母();
        CarFrameWork.Model.CanShuHua.内挡油板 ndyb = new CarFrameWork.Model.CanShuHua.内挡油板();


        public 挡油板()
        {
            InitializeComponent();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            
            if (TestContent())
            {
                FormToModel();
                ndyb.Add();
            }
            else
            {
                MessageBox.Show("参数不能为空！", "提示");
            }
        }
        private void FormToModel()
        {
            ndyb.ID = 1800031;
            ndyb.name = "内挡油板";
            ndyb.R2 = Convert.ToSingle(textBox1.Text);
            ndyb.R3 = Convert.ToSingle(textBox2.Text);
            ndyb.R4 = Convert.ToSingle(textBox3.Text);
            ndyb.H2 = Convert.ToSingle(textBox4.Text);
            ndyb.D = Convert.ToSingle(textBox5.Text);
       
        }


        private bool TestContent()
        {
            if (!InspectionText(this.textBox1))
                return false;
            if (!InspectionText(this.textBox2))
                return false;
            if (!InspectionText(this.textBox3))
                return false;
            if (!InspectionText(this.textBox4))
                return false;
            if (!InspectionText(this.textBox5))
                return false;
     
      
            return true;
        }
    }
}